#ifndef __CLIENT_CALLBACK_DATA_H__
#define __CLIENT_CALLBACK_DATA_H__

class PacketDecoder;
class ClientCallbackData : public ISocketClientCallback,public PacketDispatcher,public singleton<ClientCallbackData>
{
public:
	ClientCallbackData();
	ClientCallbackData(ISocketClient *pSocketClient);
	virtual void OnConnect();
	virtual void OnReconnect();
	virtual void OnRecvData(const void* pData, size_t nDataLen);
	virtual void OnCloseConnection();
	virtual void OnUpdate();

	ISocketClient * getSocketClient(){ return m_pSocketClient;};
	void setSocketClient(ISocketClient* p){ m_pSocketClient = p;};
	void SendPacketToData(PacketEncoder& encoder);
	void phPing(void *pData);

private:
	ISocketClient *m_pSocketClient;
};
void SendPacketToData(PacketEncoder& encoder);

#endif
//extern  "C" 
//{
// ISocketClientCallback* CreateClientCallbackData(ISocketClient*pSocketClient);
//}

